#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

static int g_global = 0;

int main()
{
    int pid = 0;
    printf("Hello World!\n");
    printf("current = %d\n", getpid());

    if ((pid = fork()) > 0) {
        g_global = 1;
        usleep(1000);
        printf("%d g_global = %d!\n", getpid(), g_global);
    } else {
        g_global = 10;
        printf("parent = %d!\n", getppid());
        printf("%d g_global = %d!\n", getpid(), g_global);
    }

    return 0;
}
